package org.example.coursemangementserver.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.example.coursemangementserver.pojo.dto.teacher.TeacherListQuery.QueryParams;
import org.example.coursemangementserver.pojo.entity.Teacher;
import org.example.coursemangementserver.pojo.vo.teacher.TeacherAuditingInfoVO;
import org.example.coursemangementserver.pojo.vo.teacher.TeacherIdWithName.TeacherIdWithNameVO;
import org.example.coursemangementserver.pojo.vo.teacher.TeacherVO;

import java.util.List;

/**
 * @author 12438
 */
public interface TeacherMapper extends BaseMapper<Teacher> {
    /**
     * 通过教师教工号查找教师信息
     * @param teacherNum
     * @return
     */
    @Select("select * from teachers where teacher_num = #{teacherNum}")
    Teacher selectByTeacherNum (String teacherNum);

    /**
     * 获取待审核的教师信息总数
     * @return
     */
    @Select("select count(*) from teachers where status = 0")
    Integer getTeacherAuditingCount();

    /**
     * 获取待审核的教师信息
     * @param start
     * @param pageSize
     * @return
     */
    List<TeacherAuditingInfoVO> getTeacherAuditing(@Param("start") Integer start, @Param("pageSize") Integer pageSize);

    /**
     * 获取正常老师信息总数
     * @param name
     * @return
     */
    Integer getTeacherTotal(@Param("name") String name);

    /**
     * 获取所有正常老师信息
     * @param start
     * @param pageSize
     * @param name
     * @return
     */
    List<TeacherVO> getTeacherList(@Param("start") Integer start, @Param("pageSize") Integer pageSize, @Param("name") String name);

    @Select("select * from teachers where teacher_id = #{teacherId}")
    Teacher getTeacherById(Long teacherId);

    List<TeacherIdWithNameVO> getTeacherIdWithName();
}
